package com.bole.controller;

import com.bole.data.Result;
import com.bole.dto.user.DicCarSpecDto;
import com.bole.feign.CarSpecFeign;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("carSpec")
public class CarSpecController {

    @Resource
    private CarSpecFeign carSpecFeign;


    @GetMapping("/findCarSpec")
    public Result findCarSpec() {
        try {
            List<DicCarSpecDto> specInfo = carSpecFeign.getSpecInfo();
            return Result.ok().setData(specInfo);
        } catch (Exception e) {
            return Result.fail().setData("获取失败");
        }
    }
}
